package com.liyz.testmodule.controller;

import com.liyz.common.util.R;
import com.liyz.testmodule.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class UserController {

    @Autowired
    private HelloService helloService;

    @RequestMapping("/test")
    public Object test(Integer id) {
        if(id == null) {
            return new R<>(new Exception("参数错误！"));
        }
        return helloService.hello(id);
    }


}
